package com.qt.myio;

import java.io.*;

/**
 * @Author zsf
 * @Date 2023/9/25 21:20
 * @Version 1.0
 */
public class FileSplit {

    /**
     * 文件分割
     * @param args
     */
    public static void main(String[] args) throws IOException {
        String src = "D:\\java测试目录\\api日志\\apusic_2023-09-20.log";
        String dir = "D:\\java测试目录\\api日志";
        int index = 1;
        FileInputStream fis = new FileInputStream(new File(src));
        FileOutputStream fos = new FileOutputStream(new File(dir, index + ".log"));
        int len;
        byte[] bytes = new byte[1024];
        while ((len = fis.read(bytes)) != -1){

            fos.write(bytes, 0, len);


        }

    }


}
